package com.kede.app.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-04-19
**/
@Entity
@Data
@Table(name="sys_area")
public class SysArea implements Serializable {
        /**
        * 
        */
    @Id
    @Column(name = "`id`")
    private Integer id;
        /**
        * 名称
        */
    @Column(name = "`name`")
    private String name;
        /**
        * 地区编码，一般为区一级
        */
    @Column(name = "`adcode`")
    private Integer adcode;
        /**
        * 城市编码
        */
    @Column(name = "`citycode`")
    private Integer citycode;
        /**
        * 
        */
    @Column(name = "`pid`")
    private Integer pid;
        /**
        * 排序
        */
    @Column(name = "`sort`")
    private Integer sort;
        /**
        * 1 省， 2 市  ，3区
        */
    @Column(name = "`level`")
    private Integer level;

    @Column(name = "`people`")
    private String people;


    public void copy(SysArea source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
